﻿@{
	ViewBag.Title = @Resources.Menu_Transport;
}
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
	<tr>
		<td class="b1">
			<div>
				<p><img src="~/images/icon_06.png" align="absmiddle" />&nbsp;@Resources.Menu_UserCenter<span>&nbsp;>>&nbsp;</span>@Resources.Menu_Transport
			</div>
		</td>
	</tr>
	<tr>
		<td class="b4">
			<div class="c">
				<div class="right" id="mainFrame">
					<div class="right_cont">
						<div id="dataGrid"></div>
						<div id="toolBar">
							<div id="searchBar">
								<div style="float: left; display: inline; padding: 5px 5px; font-weight: bold; text-align: left;">
									@Resources.ConferenceName：<input id="queryConferenceName" name="queryConferenceName" class="easyui-textbox" style="height:27px; width:200px;">&nbsp;&nbsp;
									<a class="easyui-linkbutton" iconcls="icon-search" onclick="searchData()">@Resources.Search</a>
								</div>
							</div>
							<div id="menuBar"></div>
							<div class="clear"></div>
						</div>
					</div>
				</div>
			</div>
		</td>
	</tr>
</table>
<div id="detailWindow" class="easyui-window"
	title="@Resources.LookForModify" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="dateTopicWindowTitle" class="tit01" style="text-align:left;"><a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-add" style="background:#919295;color:#000;border:none;margin-left:5px;" onclick="addTrafficBooking();">@Resources.Create</a></h3>
			<div id="detailGrid"></div>
			<input type="hidden" id="hidCurrency" />
			<input type="hidden" id="hidOrderNumber" />
		</div>
	</div>
</div>
<div id="trafficBookingWindow" class="easyui-window"
	title="@Resources.Create" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<form id="trafficForm">
				@Html.AntiForgeryToken()
				<table id="receivingBooking" style="margin-bottom: 30px;width:600px;margin:0 auto">
					<tr>
						<td valign="top" rowspan="5" style="width:13px;padding-top:20px"><input type = "checkbox" id="receivingCheckBox" name="receivingCheckBox" onchange="selectReceiving()" style="margin-top:5px"></td>
						<td style="padding-left :30px;padding-top:24px;font-size:16px;font-weight:bold"> @Resources.ReceivingService</td>
					</tr>
					<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.ArrivalDate：<input id="arrivalDate" name="arrivalDate" class="easyui-datetimebox" style="height:27px; width:400px;" data-options="editable:false" disabled></td>
					</tr>
					<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.FlightTrainNumber：<input id="arrivalNumber" name ="arrivalNumber" class="easyui-textbox" style="height:27px; width:400px;" disabled></td>
					</tr>
					<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.TrafficName：<input id="arrivalName" name ="arrivalName" class="easyui-combobox" style="height:27px; width:400px;" disabled></td>
					</tr>
					<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.Price：<span id="arrivalPrice"></span><input type="hidden" id="hidArrivalPrice"/></td>
					</tr>
				</table>
				<table class="" id="deliveryBooking" style="margin-bottom: 30px;width:600px;margin:0 auto">
						<tr>
							<td valign="top" rowspan="5" style="width:13px;padding-top:20px"><input type = "checkbox" id="deliveryCheckBox" name="deliveryCheckBox" onchange="selectDelivery()" style="margin-top:5px"></td>
							<td style="padding-left :30px;padding-top:24px;font-size:16px;font-weight:bold"> @Resources.DeliveryService</td>
						</tr>
						<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.DepartureTime：<input id="deliveryDate" name="deliveryDate" class="easyui-datetimebox" style="height:27px; width:400px;" data-options="editable:false" disabled></td>
						</tr>
						<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.FlightTrainNumber：<input id="deliveryNumber" name ="deliveryNumber" class="easyui-textbox" style="height:27px; width:400px;" disabled></td>
						</tr>
						<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.TrafficName：<input id="deliveryName" name ="deliveryName" class="easyui-combobox" style="height:27px; width:400px;" disabled></td>
						</tr>
						<tr>
						<td style="padding-left :30px;padding-top:10px">@Resources.Price：<span id="deliveryPrice"></span><input type="hidden" id="hidDeliveryPrice" /></td>
						</tr>
					</table>
				<table style="margin-bottom: 30px;width:600px;margin:0 auto">						
					<tr>
						<td valign="top" rowspan="5" style="width:13px;padding-top:20px"></td>
						<td style="padding-left :30px;padding-top:40px;"> @Resources.Contact：<input id="trafficContactName" name="trafficContactName" class="easyui-textbox" style="height:27px; width:200px;" data-options="required:true"></td>
					</tr>
					<tr>
						<td style="padding-left :30px;padding-top:10px;"> @Resources.Mobile：<input id="trafficContactMobile" name="trafficContactMobile" class="easyui-numberbox" style="height:27px; width:200px;" data-options="required:true,min:0,precision:0"></td>
					</tr>
					<tr>
						<td style="padding-left :30px;padding-top:10px;"> @Resources.Mail：<input id="trafficContactMail" name="trafficContactMail" class="easyui-textbox" style="height:27px; width:200px;" data-options="required:true,validType:['email','length[1,100]']"></td>
					</tr>
					<tr>
						<td style="padding-left :30px;padding-top:10px;height:55px" valign="top" ><span>@Resources.Remark：</span><input id="trafficRemark" name="trafficRemark" class="easyui-textbox" style="width:500px;height:50px" data-options="multiline:true,validType:['length[1,1000]']"></td>
					</tr>						
				</table>
				<input type="hidden" id="hdnSubmitType" >
				<input type="hidden" id="profileTrafficId" name="profileTrafficId">
				<input type="hidden" id="hidConferenceId" name="conferenceId"/>
			</form>
			<div class="clear"></div>
			<div style="padding: 25px 0; text-align: center;">					
				<input type="button" class="gbtn" onclick="doTrafficBooking();" value="@Resources.Submit"/>
				<input type="button" class="rbtn" onclick="$('#trafficBookingWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>

@section bodyParts {
<script>
	var windowHeight = $(window).height() - 200;
	$("#mainFrame").css("height", (windowHeight)+"px");

	$(function () {
		$("#queryConferenceName").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		$("#dataGrid").datagrid({
			url: "@Url.Action(nameof(ProfileTrafficController.GetData), nameof(ProfileTrafficController).GetControllerName())",
			method: "get",
			singleSelect: true,
			width: 1200,
			height: $(window).height() - 110,
			nowrap: false,
			pagination: true,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#toolBar",
			pageSize: 100,
			pageList: [100, 200, 300, 400, 500],
			rowStyler: function(index, row) {
				if (row.status == "@ConstValues.Status.已取消") {
					return "background-color:#CCCCCC;";
				}
			},
			columns: [[
				{
			    		field: "conferenceName", title: "@Resources.ConferenceName", align: "center", sortable: true, width: 250,
			    		formatter: function (value, rec) {
			    			var conStr = ""
			    			if (rec.homePageUrl != null && rec.homePageUrl != "") {
			    				conStr += "<a href=' "+ rec.homePageUrl +" ' style='color:#1874CD;text-decoration:underline;' target='_blank'>" + value + "</a>  "
			    			} else {
							var tmp = rec.conferenceNickName == null ? "" : rec.conferenceNickName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
							conStr += "<a href='@Url.Action(nameof(MeetingMainController.Index), nameof(MeetingMainController).GetControllerName())"
									+ "/" + tmp + "' style='color:#1874CD;text-decoration:underline;' target='_blank'>" + value + "</a>  ";
			    			}
			    			return conStr;
			    		}
				},
				{
			    		field: "operate", title: "@Resources.Operate", align: "center", width: 150,
			    		formatter: function(value, rec) {
			    			var strInfo = "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='lookForModify(\""
								+ rec.orderNum + "\",\""+ rec.conferenceId + "\",\""+ rec.currency + "\")'>@Resources.LookForModify</a>";
			    			return strInfo;
			    		}
				},
				{ field: "orderNum", title: "@Resources.OrderNum", align: "center", sortable: true, width: 200 },
				{ field: "status", title: "@Resources.Status", align: "center", sortable: true, width: 120 },
				{ field: "currency", title: "@Resources.Currency", align: "center", sortable: true, width: 100 },
				{ field: "totalFee", title: "@Resources.TotalFee", align: "center", sortable: false, width: 150 },
				{ field: "remark", title: "@Resources.Remark", align: "center", sortable: true, width: 250 },
				{ field: "contact", title: "@Resources.Contact", align: "center", sortable: true, width: 100 },
				{ field: "contactMobile", title: "@Resources.ContactPhone", align: "center", sortable: true, width: 200 },
				{ field: "contactMail", title: "@Resources.ContactMail", align: "center", sortable: true, width: 200 },
			]]
		});

		$("#detailWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
				$(this).scrollLeft(0);
			},
			top: ($(window).height() - 600) * 0.5
		});

		$("#trafficBookingWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: 100
		});

		$("#arrivalDate").datetimebox({
			showSeconds: false
		});

		$("#deliveryDate").datetimebox({
			showSeconds: false
		});
	});

	function searchData() {
		$("#dataGrid").datagrid("load", {
			conferenceName: $("#queryConferenceName").textbox("getValue"),
		});
	}

	function lookForModify(orderNum,conferenceId,currency){
		$("#detailGrid").datagrid({
			url: "@Url.Action(nameof(ProfileTrafficController.GetBookingDetail),
					nameof(ProfileTrafficController).GetControllerName())"+"?orderNum="+orderNum,
			method: "get",
			singleSelect: true,
			nowrap: false,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			rowStyler: function(index, row) {
				if (row.status == "@ConstValues.ScheduleStatus.已取消") {
					return "background-color:#CCCCCC;";
				} else if (row.isLock == true) {
					return "background-color:#ADD2EB;";
				}
			},
			frozenColumns: [[
				{
					field: "operate", title: "@Resources.Operate", align: "center", width: 150,
					formatter: function (value, rec) {
						var strInfo ;
						if (rec.status == "@ConstValues.ScheduleStatus.已取消") {
							strInfo = "<span  style='color:#000000;font-weight:bold;text-decoration:underline;' >@Resources.Modify</span>";
							strInfo += "&nbsp;|&nbsp;";
							strInfo += "<span style='color:#000000;font-weight:bold;text-decoration:underline;' '>@Resources.Cancel</span>";
						} else {
							strInfo = "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='trafficDetailModify(\""
									+ rec.id + "\",\""+ rec.trafficType + "\")'>@Resources.Modify</a>";
							strInfo += "&nbsp;|&nbsp;";
							strInfo += "<a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='cancelData(\""
									+ rec.id + "\")'>@Resources.Cancel</a>";
						}
						return strInfo;
					}
				},
				{ field: "status", title: "@Resources.Status", align: "center",  width: 150 },
			]],
			columns: [[
				{ field: "trafficType", title: "@Resources.TrafficType", align: "center", width: 150 },
				{ field: "trafficName", title: "@Resources.TrafficName", align: "center", width: 150 },
				{ field: "flightNum", title: "@Resources.FlightTrainNumber", align: "center", width: 150 },
				{ field: "flightDate", title: "@Resources.ArrivalDate", align: "center", width: 200 },
				{ field: "currency", title: "@Resources.Currency", align: "center", width: 100 },
				{ field: "price", title: "@Resources.UnitPrice", align: "center", width: 134 },
			]],
		});
		$("#hidConferenceId").val(conferenceId);
		$("#hidCurrency").val(currency);
		$("#hidOrderNumber").val(orderNum)
		$("#detailWindow").window("open");
	}

	function trafficDetailModify(id,trafficType){
		var loading = layer.load(0, {
			shade: [0.4, "#fff"]
		});
		$("#hdnSubmitType").val("edit")
		$("#profileTrafficId").val(id)
		var url = "@Url.Action(nameof(ProfileTrafficController.GetTrafficDetail),
				nameof(ProfileTrafficController).GetControllerName())" + "?id=" + id;

		$.post(url, $("#trafficForm").serialize(), function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxFailResult") {
				common.showError(data.message);
				layer.close(loading);
			} else {
				$("#arrivalName").combobox({
					url: "@Url.Action(nameof(MeetingBookingController.GetReceivingTrafficName),
							nameof(MeetingBookingController).GetControllerName())"
							+ "?conferenceId=" + $("#hidConferenceId").val()
							+"&currency="+$("#hidCurrency").val(),
					valueField: "id",
					textField: "name",
					required: true,
					editable: false,
					panelHeight: "auto",
					onSelect: function (rec) {
						if (rec.currency == "@ConstValues.Currency.美元") {
							$("span[id='arrivalPrice']").html(rec.price + " " + "@Resources.DollarPerTime");
						} else {
							$("span[id='arrivalPrice']").html(rec.price + " " + "@Resources.RmbPerTime");
						}
					}
				});
				$("#deliveryName").combobox({
					url: "@Url.Action(nameof(MeetingBookingController.GetDeliveryTrafficName),
							nameof(MeetingBookingController).GetControllerName())"
							+ "?conferenceId=" + $("#hidConferenceId").val()
							+"&currency="+$("#hidCurrency").val(),
					valueField: "id",
					textField: "name",
					required: true,
					editable: false,
					panelHeight: "auto",
					onSelect: function (rec) {
						if (rec.currency == "@ConstValues.Currency.美元") {
							$("span[id='deliveryPrice']").html(rec.price + " " + "@Resources.DollarPerTime");
						} else {
							$("span[id='deliveryPrice']").html(rec.price + " " + "@Resources.RmbPerTime");
						}
					}
				});
				if (trafficType == "@ConstValues.TrafficType.接机") {
					$("#arrivalDate").datetimebox({
						required: true,
						disabled: false
					});
					$("#arrivalDate").datetimebox("setValue", data.data.flightDate);

					$("#arrivalNumber").textbox({
						required: true,
						disabled: false
					});
					$("#arrivalNumber").textbox("setValue", data.data.flightNum);

					$("#arrivalName").combobox({
						required: true,
						disabled: false
					});
					$("#arrivalName").combobox("setValue", data.data.trafficId);
					if (data.data.currency == "@ConstValues.Currency.美元") {
						$("span[id='arrivalPrice']").html(data.data.fee + " " + "@Resources.DollarPerTime");
					} else {
						$("span[id='arrivalPrice']").html(data.data.fee + " " + "@Resources.RmbPerTime");
					}
					$("#receivingCheckBox").prop("checked",true);
					$("#deliveryCheckBox").prop("checked",false);
					$("#receivingBooking").show();
					$("#deliveryBooking").hide();
					$("#deliveryDate").datetimebox({
						required:false,
					});
					$("#deliveryNumber").textbox({
						required: false,
					});
					$("#deliveryName").combobox({
						required: false,
					});
				} else if (trafficType == "@ConstValues.TrafficType.送机") {
					$("#deliveryDate").datetimebox({
						required:true,
						disabled: false
					});
					$("#deliveryDate").datetimebox("setValue", data.data.flightDate);

					$("#deliveryNumber").textbox({
						required: true,
						disabled: false
					});
					$("#deliveryNumber").textbox("setValue", data.data.flightNum);

					$("#deliveryName").combobox({
						required: true,
						disabled: false
					});
					$("#deliveryName").combobox("setValue", data.data.trafficId);
					if (data.data.currency == "@ConstValues.Currency.美元") {
						$("span[id='deliveryPrice']").html(data.data.fee + " " + "@Resources.DollarPerTime");
					} else {
						$("span[id='deliveryPrice']").html(data.data.fee + " " + "@Resources.RmbPerTime");
					}
					$("#receivingCheckBox").prop("checked",false);
					$("#deliveryCheckBox").prop("checked",true);
					$("#receivingBooking").hide();
					$("#deliveryBooking").show();

					$("#arrivalDate").datetimebox({
						required: false,
					});
					$("#arrivalNumber").textbox({
						required: false,
					});
					$("#arrivalName").combobox({
						required: false,
					});
				} else {
					$("#receivingBooking").hide();
					$("#deliveryBooking").hide();
				}
				$("#trafficContactName").textbox("setValue", data.data.fullName);
				$("#trafficContactMobile").textbox("setValue", data.data.mobile);
				$("#trafficContactMail").textbox("setValue", data.data.mail);
				$("#trafficRemark").textbox("setValue", data.data.remark);
				layer.close(loading);
				$("#trafficBookingWindow").window("open");
				$("#trafficBookingWindow").panel({title: "@Resources.Modify"+"@Resources.TrafficBooking"});
			}
		});
	}

	function cancelData(id) {
		var confirmMessage = "@Resources.CfmCancelBook";
		$.messager.confirm("@Resources.Cancel", confirmMessage, function (r) {
			if (r) {
				$("#profileTrafficId").val(id);
				$.post("@Url.Action(nameof(ProfileTrafficController.CancelBooking),
						nameof(ProfileTrafficController).GetControllerName())",
					$("#trafficForm").serialize(),
					function(data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#dataGrid").datagrid("reload");
							$("#detailGrid").datagrid("reload");
						}
					}
				);
			}
		});
	};

	function doTrafficBooking() {
		var isValid = $("#trafficForm").form("validate");
		if (isValid) {
			var loading = layer.load(0, {
				shade: [0.4, "#fff"]
			});
			var istrue = false;
			var list = [];

			var isChooseReceiving = $("#receivingCheckBox").prop("checked") ? true : false;
			var isChooseDelivery = $("#deliveryCheckBox").prop("checked") ? true : false;

			if (isChooseReceiving) {
				var model = {};
				model.isChooseReceiving = isChooseReceiving;
				model.flightDate = $("#arrivalDate").datetimebox("getValue");
				model.flightNum = $("#arrivalNumber").textbox("getValue");
				model.trafficId = $("#arrivalName").combobox("getValue");
				model.currency = $("#hidCurrency").val();
				model.contactName = $("#trafficContactName").textbox("getValue");
				model.contactMobile = $("#trafficContactMobile").textbox("getValue");
				model.contactMail = $("#trafficContactMail").textbox("getValue");
				model.remark = $("#trafficRemark").textbox("getValue");
				model.trafficType = "@ConstValues.TrafficType.接机";
				list.push(model)
			}
			if (isChooseDelivery) {
				var model = {};
				model.isChooseDelivery = isChooseDelivery;
				model.flightDate = $("#deliveryDate").datetimebox("getValue");
				model.flightNum = $("#deliveryNumber").textbox("getValue");
				model.trafficId = $("#deliveryName").combobox("getValue");
				model.currency = $("#hidCurrency").val();
				model.trafficType = "@ConstValues.TrafficType.送机";
				model.contactName = $("#trafficContactName").textbox("getValue");
				model.contactMobile = $("#trafficContactMobile").textbox("getValue");
				model.contactMail = $("#trafficContactMail").textbox("getValue");
				model.remark = $("#trafficRemark").textbox("getValue");
				list.push(model)
			}
			if (list.length == 0) {
				layer.close(loading);
				return;
			}

			var token = $("#trafficForm").find("input[name='__RequestVerificationToken']").eq(0).val();
			var model = {};
			model.trafficList = list;
			model.conferenceId = $("#hidConferenceId").val();
			model.orderNumber = $("#hidOrderNumber").val();
			switch ($("#hdnSubmitType").val())
			{
				case "add":
					$.post("@Url.Action(nameof(ProfileTrafficController.AddTraffic),
							nameof(ProfileTrafficController).GetControllerName())",
						  {
						  	"__RequestVerificationToken": token,
						  	"model": model,
						  },
						  function (data, textStatus, jqXHR) {
						  	layer.close(loading);
						  	if (data.result == "@ConstValues.AjaxFailResult") {
						  		common.showError(data.message);
						  	} else {
						  		common.showSuccess(data.message, true);
						  		$("#dataGrid").datagrid("reload");
						  		$("#detailGrid").datagrid("reload");
						  		$("#trafficBookingWindow").window("close");
						  	}
						  }
					);
					break;
				case "edit":
					model.profileTrafficId = $("#profileTrafficId").val();
					$.post("@Url.Action(nameof(ProfileTrafficController.EditTraffic),
							nameof(ProfileTrafficController).GetControllerName())",
						  {
						  	"__RequestVerificationToken": token,
						  	"model": model,
						  },
						  function (data, textStatus, jqXHR) {
						  	layer.close(loading);
						  	if (data.result == "@ConstValues.AjaxFailResult") {
						  		common.showError(data.message);
						  	} else {
						  		common.showSuccess(data.message, true);
						  		$("#dataGrid").datagrid("reload");
						  		$("#detailGrid").datagrid("reload");
						  		$("#trafficBookingWindow").window("close");
						  	}
						  }
					);
					break;
			}
		}
	}

	function addTrafficBooking() {
		$("#hdnSubmitType").val("add")
		$("#receivingCheckBox").prop("checked",false);
		$("#deliveryCheckBox").prop("checked",false);
		$("#arrivalDate").datetimebox({
			showSeconds: false,
			disabled:true
		});
		$("#arrivalNumber").textbox({
			disabled:true
		});
		$("#arrivalName").combobox({
			disabled:true
		});
		$("#deliveryDate").datetimebox({
			showSeconds: false,
			disabled:true
		});
		$("#deliveryNumber").textbox({
			disabled:true
		});
		$("#deliveryName").combobox({
			disabled:true
		});
		$("#arrivalDate").datetimebox("setValue", "");
		$("#arrivalNumber").textbox("setValue", "");
		$("#arrivalName").combobox("setValue", "");
		$("#deliveryDate").datetimebox("setValue", "");
		$("#deliveryNumber").textbox("setValue", "");
		$("#deliveryName").combobox("setValue", "");
		$("#trafficContactName").textbox("setValue", "");
		$("#trafficContactMobile").textbox("setValue", "");
		$("#trafficContactMail").textbox("setValue", "");
		$("#trafficRemark").textbox("setValue", "");
		$("#receivingBooking").show()
		$("#deliveryBooking").show()
		$("#trafficBookingWindow").panel({title: "@Resources.Create"+"@Resources.TrafficBooking"});
		$("#trafficBookingWindow").window("open");
	}

	function selectReceiving() {
		var checkbox = document.getElementById("receivingCheckBox")
		if (checkbox.checked) {
			$("#arrivalDate").datetimebox({
				required: true,
				disabled: false
			});
			$("#arrivalNumber").textbox({
				required: true,
				disabled: false
			});
			$("#arrivalName").combobox({
				required: true,
				disabled: false
			});
			$("#arrivalName").combobox({
				url: "@Url.Action(nameof(MeetingBookingController.GetReceivingTrafficName),
						nameof(MeetingBookingController).GetControllerName())"
						+ "?conferenceId=" +$("#hidConferenceId").val()
						+"&currency="+$("#hidCurrency").val(),
				valueField: "id",
				textField: "name",
				required: true,
				editable: false,
				panelHeight: "auto",
				onSelect: function (rec) {
					if (rec.currency == "@ConstValues.Currency.美元") {
						$("span[id='arrivalPrice']").html(rec.price + " " + "@Resources.DollarPerTime");
					} else {
						$("span[id='arrivalPrice']").html(rec.price + " " + "@Resources.RmbPerTime");
					}
				}
			});
		} else {
			$("#arrivalDate").datetimebox("setValue", "");
			$("#arrivalDate").datetimebox({
				required: false,
				disabled: true
			});
			$("#arrivalNumber").textbox("setValue", "");
			$("#arrivalNumber").textbox({
				required: false,
				disabled: true
			});
			$("#arrivalName").combobox("setValue", "");
			$("#arrivalName").combobox({
				required: false,
				disabled: true
			});
		}
	}

	function selectDelivery() {
		var checkbox = document.getElementById("deliveryCheckBox")
		if (checkbox.checked) {
			$("#deliveryDate").datetimebox({
				required:true,
				disabled: false
			});
			$("#deliveryNumber").textbox({
				required: true,
				disabled: false
			});
			$("#deliveryName").combobox({
				required: true,
				disabled: false
			});
			$("#deliveryName").combobox({
				url: "@Url.Action(nameof(MeetingBookingController.GetDeliveryTrafficName),
						nameof(MeetingBookingController).GetControllerName())"
						+ "?conferenceId=" +$("#hidConferenceId").val()
						+"&currency="+$("#hidCurrency").val(),
				valueField: "id",
				textField: "name",
				required: true,
				editable: false,
				panelHeight: "auto",
				onSelect: function (rec) {
					if (rec.currency == "@ConstValues.Currency.美元") {
						$("span[id='deliveryPrice']").html(rec.price + " " + "@Resources.DollarPerTime");
					} else {
						$("span[id='deliveryPrice']").html(rec.price + " " + "@Resources.RmbPerTime");
					}
				}
			});
		} else {
			$("#deliveryDate").datetimebox("setValue", "");
			$("#deliveryDate").datetimebox({
				required: false,
				disabled: true
			});
			$("#deliveryNumber").textbox("setValue", "");
			$("#deliveryNumber").textbox({
				required: false,
				disabled: true
			});
			$("#deliveryName").combobox("setValue", "");
			$("#deliveryName").combobox({
				required: false,
				disabled: true
			});
		}
	}
</script>
}